<?php

/**
 * OperadoresEgresos filter form base class.
 *
 * @package    cronos-doctrine
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseOperadoresEgresosFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'tipo_concepto_cf_id'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('TipoConceptoCf'), 'add_empty' => true)),
      'concepto_cf_id'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ConceptoCf'), 'add_empty' => true)),
      'empresa_id'              => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Empresa'), 'add_empty' => true)),
      'camioneta_id'            => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Camioneta'), 'add_empty' => true)),
      'operador_id'             => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Operador'), 'add_empty' => true)),
      'is_franquicia'           => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'operadores_prestamos_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('OperadoresPrestamos'), 'add_empty' => true)),
      'cantidad'                => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'descripcion'             => new sfWidgetFormFilterInput(),
      'monto'                   => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'monto_deposito'          => new sfWidgetFormFilterInput(),
      'monto_pago'              => new sfWidgetFormFilterInput(),
      'efectivo'                => new sfWidgetFormFilterInput(),
      'noingreso'               => new sfWidgetFormFilterInput(),
      'adeudo'                  => new sfWidgetFormFilterInput(),
      'saldo_favor'             => new sfWidgetFormFilterInput(),
      'saldo_favor_menos'       => new sfWidgetFormFilterInput(),
      'fecha'                   => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'cancelacion_razon_id'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('CancelacionRazon'), 'add_empty' => true)),
      'nota'                    => new sfWidgetFormFilterInput(),
      'nota_operador'           => new sfWidgetFormFilterInput(),
      'nota_gerente'            => new sfWidgetFormFilterInput(),
      'is_vista'                => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'created_at'              => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'updated_at'              => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
    ));

    $this->setValidators(array(
      'tipo_concepto_cf_id'     => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('TipoConceptoCf'), 'column' => 'id')),
      'concepto_cf_id'          => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('ConceptoCf'), 'column' => 'id')),
      'empresa_id'              => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Empresa'), 'column' => 'id')),
      'camioneta_id'            => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Camioneta'), 'column' => 'id')),
      'operador_id'             => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Operador'), 'column' => 'id')),
      'is_franquicia'           => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'operadores_prestamos_id' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('OperadoresPrestamos'), 'column' => 'id')),
      'cantidad'                => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'descripcion'             => new sfValidatorPass(array('required' => false)),
      'monto'                   => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'monto_deposito'          => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'monto_pago'              => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'efectivo'                => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'noingreso'               => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'adeudo'                  => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'saldo_favor'             => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'saldo_favor_menos'       => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'fecha'                   => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'cancelacion_razon_id'    => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('CancelacionRazon'), 'column' => 'id')),
      'nota'                    => new sfValidatorPass(array('required' => false)),
      'nota_operador'           => new sfValidatorPass(array('required' => false)),
      'nota_gerente'            => new sfValidatorPass(array('required' => false)),
      'is_vista'                => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'created_at'              => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'updated_at'              => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('operadores_egresos_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'OperadoresEgresos';
  }

  public function getFields()
  {
    return array(
      'id'                      => 'Number',
      'tipo_concepto_cf_id'     => 'ForeignKey',
      'concepto_cf_id'          => 'ForeignKey',
      'empresa_id'              => 'ForeignKey',
      'camioneta_id'            => 'ForeignKey',
      'operador_id'             => 'ForeignKey',
      'is_franquicia'           => 'Boolean',
      'operadores_prestamos_id' => 'ForeignKey',
      'cantidad'                => 'Number',
      'descripcion'             => 'Text',
      'monto'                   => 'Number',
      'monto_deposito'          => 'Number',
      'monto_pago'              => 'Number',
      'efectivo'                => 'Number',
      'noingreso'               => 'Number',
      'adeudo'                  => 'Number',
      'saldo_favor'             => 'Number',
      'saldo_favor_menos'       => 'Number',
      'fecha'                   => 'Date',
      'cancelacion_razon_id'    => 'ForeignKey',
      'nota'                    => 'Text',
      'nota_operador'           => 'Text',
      'nota_gerente'            => 'Text',
      'is_vista'                => 'Boolean',
      'created_at'              => 'Date',
      'updated_at'              => 'Date',
    );
  }
}
